package com.example.senior_config.controller;

import com.example.senior_config.service.PushService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.async.DeferredResult;

/**
 * @description
 * @author ljw
 * @date 2021/9/14 7:53
 */
@RestController
public class AysncController {

    @Autowired
    private PushService pushService;

    @RequestMapping("/defer")
    public DeferredResult<String> deferredCall() {
        return pushService.getAsyncUpdate();
    }
}
